/**
 * 
 */
package com.jeecms.wicool.dao.product.impl;

import java.util.List;

import com.jeecms.common.hibernate3.Finder;
import com.jeecms.common.hibernate3.HibernateBaseDao;
import com.jeecms.common.hibernate3.Updater;
import com.jeecms.wicool.dao.product.ProductInnerRelationDao;
import com.jeecms.wicool.entity.product.ProductInnerRelation;

/**
 * @author spring
 *
 */
public class ProductInnerRelationDaoImpl extends HibernateBaseDao<ProductInnerRelation, Integer>
		implements ProductInnerRelationDao {

	@Override
	public ProductInnerRelation save(ProductInnerRelation bean) {
		 getSession().save(bean);
		return bean;
	}

	@Override
	public List<ProductInnerRelation> getListProductInnerRelation(
			Integer productId) {
		 Finder f = Finder.create("select bean from ProductInnerRelation bean where 1=1 ");
	        if (productId != null) {
	            f.append(" and bean.productId = :productId");
	            f.setParam("productId", productId);
	        }
	        return find(f);
	}

	@Override
	protected Class<ProductInnerRelation> getEntityClass() {
		return ProductInnerRelation.class;
	}

}
